/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.model.generators.modelproviders;

import java.awt.Color;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.animationTime.Timeline;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.interpolators.Linear;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.ChangeBorderColor;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.ChangeBorderWidth;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.ChangeFillColor;
import pl.edu.amu.wmi.kino.visualjavafx.model.api.ModelChangeEvent;
import pl.edu.amu.wmi.kino.visualjavafx.model.api.ModelChangeListener;
import pl.edu.amu.wmi.kino.visualjavafx.model.api.VisualJavaFxModelProvider;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelCanvasGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelChangeBorderColorGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelChangeBorderWidthGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelChangeFillColorGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelCircleGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.generators.ModelFrameGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Application;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Canvas;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Frame;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.shapes.Circle;

/**
 *
 * @author Admin
 */


public class CircleTest4Provider implements VisualJavaFxModelProvider{

    @Override
    public Application getModel() {
       Application app = new Application();
        ArrayList<Frame> frames = app.getFrames();
        Canvas can = ModelCanvasGenerator.generateCanvas(Color.PINK);

        Circle c = ModelCircleGenerator.generateCircle(500, 300, 100, Color.RED, Color.GREEN,
                5);

        ChangeBorderColor c1 = ModelChangeBorderColorGenerator.generateChangeBorderColor(new Linear(), Color.ORANGE);
        ChangeBorderColor c2 = ModelChangeBorderColorGenerator.generateChangeBorderColor(new Linear(), Color.GREEN);

        ChangeFillColor f1= ModelChangeFillColorGenerator.generateChangeFillColor(new Linear(), Color.YELLOW);
        ChangeFillColor f2 = ModelChangeFillColorGenerator.generateChangeFillColor(new Linear(), Color.GRAY);

        ChangeBorderWidth w1 = ModelChangeBorderWidthGenerator.generateChangeBorderWidth(new Linear(), 20);
        ChangeBorderWidth w2 = ModelChangeBorderWidthGenerator.generateChangeBorderWidth(new Linear(), 1);
        Timeline timeline = c.getTimeline();
        
        timeline.getKeyFrameAt(3).getTransformations().add(c1);
        timeline.getKeyFrameAt(3).getTransformations().add(f1);
        timeline.getKeyFrameAt(3).getTransformations().add(w1);
        
        timeline.getKeyFrameAt(6).getTransformations().add(c2);
        timeline.getKeyFrameAt(6).getTransformations().add(f2);
        timeline.getKeyFrameAt(6).getTransformations().add(w2);


        can.getContent().add(c);

        Frame f = ModelFrameGenerator.generateFrame(1000, 800, 50, 50, "test", can);
        frames.add(f);

        return app;
    }


    @Override
    public void addModelChangeListener(ModelChangeListener listener) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void notifyModelChange(ModelChangeEvent evt) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void removeModelChangeListener(ModelChangeListener listener) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
